package cn.edu.lingnan.demo.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration//配置文件：使用java类实现SpringBoot配置文件
public class MyBatisPlusConfig {
    /**
     * mybatis-plus分页插件
     */
    @Bean//以前的写法：<bean></bean>,也可以传入名称（“id”）不指明则是方法名
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        return paginationInterceptor;
    }
}